home *** CD-ROM | disk | FTP | other *** search
/ Compendium Deluxe 1 / LSD Compendium Deluxe 1.iso / a / programming / assembly / matrixvec.lha / storage / vectors / FILLED-VECTOR.S
Encoding:
Text File  |  1980-01-01  |  17.4 KB  |  659 lines

  1. ; filled vector example by matrix/plague
  2.  
  3.  
  4. ;The source is partially optimised (E.g. I never really had a slow routine!)
  5. ;It is also documented. However! There are certain things that you should
  6. ;keep to mind :-
  7. ;If you will be coding a vector-routine sometime, then you will need to keep
  8. ;The LINEDRAW routine.
  9. ;-This routine was not coded by me, it has been published in several
  10. ;-books, so there is no need to write a new one!
  11. ;-Also it is extremely fast anyway!
  12.  
  13. ;The source is split into 3 main areas :-
  14. ;1) Calculate point rotation
  15. ;2) Calculate visible surfaces and draw lines between points
  16. ;3) Fill bitplanes.
  17.  
  18. ;A general idea of matrix-maths is preferable but not necessary
  19. ;(My maths is terrible!)
  20. ;So, with that in mind, i have also included some text that has
  21. ;an explanation of vector calculation by kreator/anarchy. This should
  22. ;explain the actual point rotation a lot better than me.
  23.  
  24. ;-To better understand kreators explanation i have included some source
  25. ;-which he gave away at the same time, this is similar to mine
  26. ;-but his follows the explanation, whereas mine does not.
  27.  
  28. ;The bit that he doesn't tell you about is the surface calculation :-
  29.  
  30. ;Put simply this calculates which way the vector points
  31. ;were rotated in, if the result is negative then the surface is anti-clockwise and not
  32. ;visible. Your actual surface structure must be defined clockwise (all points
  33. ;going clockwise).
  34.  
  35. ;Have fun !!
  36. ;Signed : Matrix/Plague
  37.  
  38. ;If it is not documented enough then contact me and i will try and answer
  39. ;any questions you may have.
  40. ;But it would be better to keep this source somewhere safe and use routines
  41. ;from it!
  42.  
  43. ********************************************
  44. ** SYSTEM EQUATES AND CHIP RAM ASSIGNMENT **
  45. ********************************************
  46.  
  47.     SECTION    Matrix1,CODE_C
  48.  
  49. execbase    = 4
  50. trap0        = $80
  51. openlibrary    = -552
  52. closelibrary    = -414
  53.  
  54. wblit    macro
  55. wblt\@    btst    #6,$2(a6)
  56.     bne.s    wblt\@
  57.     endm
  58.  
  59. ********************************************
  60. ** INITIALISATION AND START ROUTINES      **
  61. ********************************************
  62.  
  63. start    movem.l    d0-d7/a0-a6,-(sp)
  64.     move.l    #start2,trap0
  65.     trap    #0
  66.     movem.l    (sp)+,d0-d7/a0-a6
  67.     moveq.l    #0,d0
  68.     rts
  69.  
  70. start2    bsr.s    systemsetup
  71.     bsr    doblits
  72.     bsr    insertbitplanes
  73.     bsr    insertsprites
  74.     bsr    makecopper
  75.     bsr    initcopper
  76.     bsr    mainloop
  77.     bsr    restoreos
  78.     rte
  79.  
  80. ********************************************
  81. ** STORE REGISTERS AND SET NEW CONTENTS   **
  82. ********************************************
  83.  
  84. systemsetup
  85.     move.l    (execbase).w,a6
  86.     lea    gfxname,a1
  87.     moveq.l    #0,d0
  88.     jsr    openlibrary(a6)
  89.     move.l    d0,gfxbase
  90.     lea    $dff000,a6
  91.     bset    #1,$bfe001
  92.     move.w    #32,$1dc(a6)
  93.     clr.l    $0
  94.     move.w    $1c(a6),intesave
  95.     or.w    #$8000,intesave
  96.     move.w    $1e(a6),intrsave
  97.     or.w    #$8000,intrsave
  98.     move.w    $2(a6),dmasave
  99.     or.w    #$8000,dmasave
  100.     move.w    $10(a6),adksave
  101.     or.w    #$8000,adksave
  102. sswbeam    move.l    $4(a6),d0
  103.     and.l    #$1ff00,d0
  104.     lsr.l    #8,d0
  105.     cmpi.w    #305,d0
  106.     bne.s    sswbeam
  107.     move.w    #$7fff,$dff096
  108.     move.w    #$87e0,$dff096
  109.     move.w    #$7fff,$dff09a
  110.     rts
  111.  
  112. ********************************************
  113. ** DO ANY SETUP BLITS - PUTTING GRAPHICS  **
  114. ** INTO BITPLANES ETC                     **
  115. ********************************************
  116.  
  117. doblits    move.l    #-1,$44(a6)
  118.     move.l    #0,$64(a6)
  119.     move.l    #$01000000,$40(a6)
  120.     wblit
  121.     rts
  122.  
  123. ********************************************
  124. ** INSERT THE BITPLANE POINTERS INTO THE  **
  125. ** COPPERLIST STRUCTURE              **
  126. ********************************************
  127.  
  128. insertbitplanes
  129.     move.l    #vecplane1,d0
  130.     move.w    d0,vecpl1+6
  131.     swap    d0
  132.     move.w    d0,vecpl1+2
  133.     swap    d0
  134.     add.l    #40*171,d0
  135.     move.w    d0,vecpl2+6
  136.     swap    d0
  137.     move.w    d0,vecpl2+2
  138.     rts
  139.  
  140. ********************************************
  141. ** INSERT THE HARDWARE SPRITE POINTERS    **
  142. ** INTO THE COPPERLIST STRUCTURE          **
  143. ********************************************
  144.  
  145. insertsprites
  146.     rts
  147.  
  148. ********************************************
  149. ** PERFORM ALL THE BORING COPPER TASKS    **
  150. ** SUCH AS MAKING LARGE COLOURED BARS     **
  151. ********************************************
  152.  
  153. makecopper
  154.     rts
  155.  
  156. ********************************************
  157. ** SWITCH ON THE COPPER START ADDRESS     **
  158. ********************************************
  159.  
  160. initcopper
  161.     move.l    #newcopper,$80(a6)
  162.     move.w    $88(a6),d0
  163.     rts
  164.  
  165. ********************************************
  166. ** RESTORE THE SAVED DMA/INTERRUPT        **
  167. ** REGISTERS AND THE STANDARD COPPER LIST **
  168. ********************************************
  169.  
  170. restoreos
  171.     move.w    intesave,$9a(a6)
  172.     move.w    intrsave,$9c(a6)
  173.     move.w    dmasave,$96(a6)
  174.     move.w    adksave,$9e(a6)
  175.     move.l    gfxbase,a0
  176.     move.l    38(a0),$80(a6)
  177.     move.w    $88(a6),d0
  178.     move.l    (execbase).w,a6
  179.     move.l    gfxbase,a1
  180.     jsr    closelibrary(a6)
  181.     rts
  182.  
  183. ********************************************
  184. ** THE MAIN PROGRAM LOOP                  **
  185. ********************************************
  186.  
  187. mainloop
  188.     move.l    $4(a6),d0
  189.     and.l    #$1ff00,d0
  190.     cmpi.l    #$ff00,d0
  191.     bne.s    mainloop
  192.     bsr    filledvectors
  193.     btst    #6,$bfe001
  194.     bne.s    mainloop
  195.     rts
  196.  
  197. ********************************************
  198. ** FILLED-VECTOR ROUTINE V1.0             **
  199. ********************************************
  200.  
  201. sincos    macro
  202.     move.w    64(a1,d6),d4    ;get cosine value
  203.     move.w    -64(a1,d6),d5    ;get sine value
  204.     move.w    d0,d2        ;get copy of val1=val3
  205.     move.w    d1,d3        ;get copy of val2=val4
  206.     muls    d4,d0        ;get cosine value of val1
  207.     muls    d5,d1        ;get sine value of val2
  208.     muls    d4,d3        ;get cosine value val4
  209.     muls    d5,d2        ;get sine value val3
  210.     sub.l    d1,d0        ;val1=val1-val2
  211.     add.l    d0,d0        ;*2
  212.     add.l    d2,d3        ;val4=val3+val4
  213.     add.l    d3,d3        ;*2
  214.     swap    d0        ;get high word
  215.     swap    d3        ;get high word
  216.     endm
  217.  
  218. calcrot    macro
  219.     move.w    (a0)+,d0        ;get x point
  220.     move.w    (a0)+,d1        ;get y point
  221.     move.w    yrotate,d6        ;y rotation angle
  222.     sincos
  223.     move.w    d0,xstore
  224.     move.w    d3,d0
  225.     move.w    (a0)+,d1        ;get z point
  226.     move.w    zrotate,d6        ;z rotation angle
  227.     sincos
  228.     move.w    d0,ystore
  229.     move.w    d3,d0
  230.     move.w    xstore,d1
  231.     move.w    xrotate,d6        ;x rotation angle
  232.     sincos
  233.     move.w    ystore,d1
  234.     endm
  235.  
  236. filledvectors
  237.     subq.w    #4,xrotate        ;inc/dec x-rotation angle
  238.     and.w    #$1ff,xrotate
  239.     addq.w    #2,yrotate        ;inc/dec y-rotation angle
  240.     and.w    #$1ff,yrotate
  241.     addq.w    #2,zrotate        ;inc/dec z-rotation angle
  242.     and.w    #$1ff,zrotate
  243.  
  244.     lea    filpoints,a0    ;get address of vector-points
  245.     lea    vectorsine+64,a1    ;get address of sinetable
  246.     lea    filstore,a2        ;get address of calculated point storage
  247.                 ;area
  248.     move.w    (a0)+,d7        ;get number of points
  249. filcalc    calcrot
  250.     moveq.l    #10,d4
  251.     move.w    #920,d2        ;scale size:bigger number=bigger vector
  252.     sub.w    d3,d2        ;subtract coord z-size
  253.     muls    d2,d0        ;scale x
  254.     asr.l    d4,d0        ;scale x
  255.     muls    d2,d1        ;scale y
  256.     asr.l    d4,d1        ;scale y
  257.     add.w    #97,d0        ;centralise x-points
  258.     add.w    #85,d1        ;centralise y-points
  259.     move.w    d0,(a2)+        ;store x
  260.     move.w    d1,(a2)+        ;store y
  261.     dbf    d7,filcalc        ;do more ?
  262.  
  263.     move.l    #-1,$44(a6)
  264.     move.l    #-$8000,$72(a6)
  265.     move.w    #20,$60(a6)        ;20=vectorplane size
  266.     lea    filstore,a1        ;get address of coord-storage area
  267.     lea    filconnects,a2    ;get line-connection list
  268.     lea    filshift,a3        ;get pre-calc line-shift table
  269.     lea    llength,a5        ;get pre-calc line-length table
  270.     lea    filsurfaces,a6    ;get address of surface structures
  271.     move.w    (a6)+,filsurfaceno    ;get number of surfaces on vector
  272. fildrawlp1
  273.     move.l    (a6)+,d7        ;get number of sides to surface
  274.     move.l    (a6)+,a4        ;get address of surface list
  275.     move.l    (a6)+,a0        ;get address of bitplane to draw to
  276.     move.l    (a6)+,filblitno    ;get double-line flag
  277.     move.w    (a4),d6        ;calculate if surface visible
  278.     move.w    (a2,d6),d4
  279.     move.w    2(a2,d6),d5
  280.     move.w    (a1,d4),d0
  281.     sub.w    (a1,d5),d0
  282.     move.w    2(a1,d4),d1
  283.     sub.w    2(a1,d5),d1
  284.     move.w    2(a4),d6
  285.     move.w    (a2,d6),d4
  286.     move.w    2(a2,d6),d5
  287.     move.w    (a1,d4),d2
  288.     sub.w    (a1,d5),d2
  289.     move.w    2(a1,d4),d3
  290.     sub.w    2(a1,d5),d3
  291.     muls    d3,d0
  292.     muls    d2,d1
  293.     cmp.w    d0,d1
  294.     bmi.s    filndraw2        ;result negative-dont draw
  295.     move.l    a6,-(a7)
  296.     lea    $dff000,a6
  297.     tst.l    filblitno
  298.     beq.s    filns1
  299.     st.b    filblit1
  300. filns1    bsr    linedraw        ;draw lines
  301.     move.l    (a7)+,a6
  302. filndraw2
  303.     subq.w    #1,filsurfaceno
  304.     tst.w    filsurfaceno
  305.     bne.s    fildrawlp1
  306.     lea    $dff000,a6
  307.  
  308.     bsr.s    fillblit        ;Fill it
  309.  
  310.     move.l    vecplaneptr1,d0        ;Double-Buffer
  311.     move.l    vecplaneptr2,d1
  312.     move.l    d1,vecplaneptr1
  313.     move.l    d0,vecplaneptr2
  314.     move.w    d0,vecpl1+6
  315.     swap    d0
  316.     move.w    d0,vecpl1+2
  317.     swap    d0
  318.     add.l    #40*171,d0
  319.     move.w    d0,vecpl2+6
  320.     swap    d0
  321.     move.w    d0,vecpl2+2
  322.     rts
  323.  
  324. ********************************************
  325. ** FILL THE SOLID VECTOR PLANES AND THEN  **
  326. ** CLEAR THEM                             **
  327. ********************************************
  328.  
  329. fillblit
  330.     lea    vecbuff3-(20*6),a0    ;address bottom of vectorplane
  331.     move.l    vecplaneptr1,a1    ;get address of bitplane
  332.     add.l    #((40*171)*2)-(40*6)-22,a1    ;get address of bottom of bitplane
  333.     wblit            ;wait for previous linedraw to finish
  334.     move.l    #$09f00012,$40(a6)    ;set copy/fill/descending mode
  335.                 ;descending mode needed for filling
  336.     move.w    #0,$64(a6)
  337.     move.w    #20,$66(a6)
  338.     move.l    a0,$50(a6)        ;vectorplane address
  339.     move.l    a1,$54(a6)        ;bitplane address
  340.     move.w    #(168+165)*64+10,$58(a6)    ;set bltsize
  341.     wblit
  342.     move.l    #$01000000,$40(a6)    ;clear vectorplane
  343.     move.w    #0,$66(a6)
  344.     move.l    #vecbuff1,$54(a6)
  345.     move.w    #(171*2)*64+10,$58(a6)
  346.     wblit
  347.     rts
  348.  
  349. ********************************************
  350. ** FILLED LINEDRAW ROUTINE                **
  351. **                  **
  352. ** PRELOAD :              **
  353. ** $DFF060=SCREENWIDTH (WORD)          **
  354. ** $DFF072=-$8000 (LONGWORD)          **
  355. ** $DFF044=-1 (LONGWORD)          **
  356. **                  **
  357. ** INPUT :                  **
  358. ** D0=X1 D1=Y1 D2=X2 D3=Y2                **
  359. ** A0=SCREEN ADDRESS                      **
  360. ** A3=X-SHIFT TABLE              **
  361. ** A5=LINE-SIZE TABLE              **
  362. ********************************************
  363.  
  364. linedraw
  365.     move.w    (a4)+,d5
  366.     move.w    (a2,d5),d6
  367.     move.w    (a1,d6),d0        ;get x1
  368.     move.w    2(a1,d6),d1        ;get y1
  369.     move.w    2(a2,d5),d6
  370.     move.w    (a1,d6),d2        ;get x2
  371.     move.w    2(a1,d6),d3        ;get y2
  372.     moveq.l    #20,d5            ;vectorplane width (bytes)
  373.     cmp.w    d1,d3
  374.     bgt.s    line1
  375.     exg    d0,d2
  376.     exg    d1,d3
  377.     beq    ldout
  378. line1    movem.w    d0/d1/d2/d3/d5,-(a7)    ;store coord registers
  379.     move.w    d1,d4
  380.     muls    d5,d4
  381.     move.w    d0,d5
  382.     add.l    a0,d4
  383.     asr.w    #3,d5
  384.     add.w    d5,d4
  385.     moveq    #0,d5
  386.     sub.w    d1,d3
  387.     sub.w    d0,d2
  388.     bpl.s    line2
  389.     moveq    #1,d5
  390.     neg.w    d2
  391. line2    move.w    d3,d1
  392.     add.w    d1,d1
  393.     cmp.w    d2,d1
  394.     dbhi    d3,line3
  395. line3    move.w    d3,d1
  396.     sub.w    d2,d1
  397.     bpl.s    line4
  398.     exg    d2,d3
  399. line4    addx.w    d5,d5
  400.     add.w    d2,d2
  401.     move.w    d2,d1
  402.     sub.w    d3,d2
  403.     addx.w    d5,d5
  404.     add.w    d0,d0
  405.     wblit
  406.     move.w    d2,$52(a6)
  407.     sub.w    d3,d2
  408.     add.w    d3,d3
  409.     move.w    (a3,d0),$40(a6)
  410.     move.b    oct(PC,d5.w),$43(a6)
  411.     move.l    d4,$48(a6)
  412.     move.l    d4,$54(a6)
  413.     movem.w    d1/d2,$62(a6)
  414.     move.w    (a5,d3),$58(a6)
  415.     movem.w    (a7)+,d0/d1/d2/d3/d5    ;restore coords
  416.     tst.b    filblit1        ;test if double-line needed
  417.     beq.s    ldout
  418.     lea    vecbuff2,a0        ;address second plane
  419.     bsr.s    linedraw2        ;draw it
  420.     lea    vecbuff1,a0        ;address first plane again
  421. ldout    dbf    d7,linedraw        ;more ?
  422.     clr.b    filblit1        ;clear double-line toggle
  423.     rts
  424.     
  425. ********************************************
  426. ** OCTANTS FOR LINES - MUST BE HERE       **
  427. ** REMAIN PC-RELATIVE                     **
  428. ********************************************
  429.  
  430. oct        dc.l    $3431353,$b4b1757
  431.     even
  432.  
  433. ********************************************
  434. ** SECOND LINE-DRAWER ROUTINE WHEN BOTH   **
  435. ** PLANES NEEDED FOR SURFACE              **
  436. ********************************************
  437.  
  438. linedraw2
  439.     move.w    d1,d4
  440.     muls    d5,d4
  441.     move.w    d0,d5
  442.     add.l    a0,d4
  443.     asr.w    #3,d5
  444.     add.w    d5,d4
  445.     moveq    #0,d5
  446.     sub.w    d1,d3
  447.     sub.w    d0,d2
  448.     bpl.s    line5
  449.     moveq    #1,d5
  450.     neg.w    d2
  451. line5    move.w    d3,d1
  452.     add.w    d1,d1
  453.     cmp.w    d2,d1
  454.     dbhi    d3,line6
  455. line6    move.w    d3,d1
  456.     sub.w    d2,d1
  457.     bpl.s    line7
  458.     exg    d2,d3
  459. line7    addx.w    d5,d5
  460.     add.w    d2,d2
  461.     move.w    d2,d1
  462.     sub.w    d3,d2
  463.     addx.w    d5,d5
  464.     add.w    d0,d0
  465.     wblit
  466.     move.w    d2,$52(a6)
  467.     sub.w    d3,d2
  468.     add.w    d3,d3
  469.     move.w    (a3,d0),$40(a6)
  470.     move.b    oct(PC,d5.w),$43(a6)
  471.     move.l    d4,$48(a6)
  472.     move.l    d4,$54(a6)
  473.     movem.w    d1/d2,$62(a6)
  474.     move.w    (a5,d3),$58(a6)
  475.     rts
  476.  
  477. ********************************************
  478. ** THE PROGRAMS USER-DEFINED COPPERLIST   **
  479. ********************************************
  480.  
  481. newcopper
  482.     dc.w $120,$0,$122,$0,$124,$0,$126,$0
  483.     dc.w $128,$0,$12a,$0,$12c,$0,$12e,$0
  484.     dc.w $130,$0,$132,$0,$134,$0,$136,$0
  485.     dc.w $138,$0,$13a,$0,$13c,$0,$13e,$0
  486.     dc.w $108,$0,$10a,$0
  487.     dc.w $92,$38,$94,$d0
  488.     dc.w $8e,$1a64,$90,$39d1
  489.     dc.w $180,$203,$102,$0,$104,$0
  490.     dc.w $100,$0
  491. veccop    dc.w $182,$a0e,$184,$608,$186,$80a
  492. vecpl1    dc.w $e0,$0,$e2,$0
  493. vecpl2    dc.w $e4,$0,$e6,$0
  494.     dc.w $7101,$fffe
  495.     dc.w $100,$2200
  496.     dc.w $ffe1,$fffe
  497.     dc.w $1d01,$fffe,$100,$0
  498.     dc.w $ffff,$fffe
  499.  
  500. ********************************************
  501. ** PROGRAM STORAGE AREA, USED FOR STORES  **
  502. ** FLAGS, COUNTERS ETC              **
  503. ** AND ANY INCLUDE BINARY DIRECTIVES      **
  504. ********************************************
  505.  
  506. gfxname        dc.b    "graphics.library",0
  507. gfxbase        dc.l    0
  508. intesave    dc.w    0
  509. intrsave    dc.w    0
  510. dmasave        dc.w    0
  511. adksave        dc.w    0
  512.     even
  513. xrotate        dc.w    0    ;xrotate angle
  514. yrotate        dc.w    0    ;yrotate angle
  515. zrotate        dc.w    0    ;zrotate angle
  516. xstore        dc.w    0    ;x temp-storage area
  517. ystore        dc.w    0    ;y temp-storage area
  518. filsurfaceno    dc.w    0    ;number of sides on vector
  519. filblitno    dc.l    0        ;double-line flag
  520. filblit1    dc.b    0        ;double-line flag2
  521. filpoints    dc.w    8-1        ;number of points (-1 for dbf)
  522.         dc.w     50,+50,+50
  523.         dc.w    -50,+50,+50
  524.         dc.w    -50,-50,+50
  525.         dc.w     50,-50,+50
  526.         dc.w     50,+50,-50
  527.         dc.w    -50,+50,-50
  528.         dc.w    -50,-50,-50
  529.         dc.w     50,-50,-50
  530. conect        macro
  531.         dc.w    \1*4,\2*4
  532.         endm
  533. filconnects    conect    0,1        ;which points join to which !
  534.         conect    1,2
  535.         conect    2,3
  536.         conect    3,0
  537.         conect    4,5
  538.         conect    5,6
  539.         conect    6,7
  540.         conect    7,4
  541.         conect    0,4
  542.         conect    1,5
  543.         conect    2,6
  544.         conect    3,7
  545. filsurfaces        dc.w    6    ;6 surfaces on a cube
  546.  
  547.         dc.l    3,fsurface1,vecbuff1,1    ;3-1 sides per surface
  548.                     ;list of points to draw to
  549.                     ;address of bitplane to draw to
  550.                     ;double-line flag
  551.         dc.l    3,fsurface2,vecbuff1,0
  552.         dc.l    3,fsurface3,vecbuff2,0
  553.         dc.l    3,fsurface4,vecbuff1,0
  554.         dc.l    3,fsurface5,vecbuff2,0
  555.         dc.l    3,fsurface6,vecbuff1,1
  556. ssurf        macro
  557.         dc.w    \1*4,\2*4,\3*4,\4*4
  558.         endm
  559. fsurface1    ssurf    4,5,6,7            ;which connecting lines form
  560.                     ;to make a surface
  561. fsurface2    ssurf    3,11,7,8
  562. fsurface3    ssurf    0,9,4,8
  563. fsurface4    ssurf    1,9,5,10
  564. fsurface5    ssurf    2,10,6,11
  565. fsurface6    ssurf    3,2,1,0
  566. filstore    ds.w    8*2            ;x/y storage area
  567. a set 0                    ;table for line-shift vals
  568. filshift
  569.         rept    320
  570.         dc.w    ((a&$f)*$1000)+$a4a
  571. a set a+1
  572.         endr
  573. a set 0
  574. llength                    ;table for line length vals
  575.         rept    320
  576.         dc.w    a*64+2
  577. a set a+1
  578.         endr
  579. ;sine table for vector rotation
  580. vectorsine        DC.W    $0000,$0324,$0647,$096A,$0C8B,$0FAB,$12C7,$15E1
  581.         DC.W    $18F8,$1C0B,$1F19,$2223,$2527,$2826,$2B1F,$2E10
  582.         DC.W    $30FB,$33DE,$36B9,$398C,$3C56,$3F17,$41CD,$447A
  583.         DC.W    $471C,$49B3,$4C3F,$4EBF,$5133,$539A,$55F5,$5842
  584.         DC.W    $5A82,$5CB3,$5ED7,$60EB,$62F1,$64E8,$66CF,$68A6
  585.         DC.W    $6A6D,$6C23,$6DC9,$6F5E,$70E2,$7254,$73B5,$7504
  586.         DC.W    $7641,$776B,$7884,$7989,$7A7C,$7B5C,$7C29,$7CE3
  587.         DC.W    $7D89,$7E1D,$7E9C,$7F09,$7F61,$7FA6,$7FD8,$7FF5
  588.         DC.W    $7FFF,$7FF5,$7FD8,$7FA6,$7F61,$7F09,$7E9C,$7E1D
  589.         DC.W    $7D89,$7CE3,$7C29,$7B5C,$7A7C,$7989,$7884,$776B
  590.         DC.W    $7641,$7504,$73B5,$7254,$70E2,$6F5E,$6DC9,$6C23
  591.         DC.W    $6A6D,$68A6,$66CF,$64E8,$62F1,$60EB,$5ED7,$5CB3
  592.         DC.W    $5A82,$5842,$55F5,$539A,$5133,$4EBF,$4C3F,$49B3
  593.         DC.W    $471C,$447A,$41CD,$3F17,$3C56,$398C,$36B9,$33DE
  594.         DC.W    $30FB,$2E10,$2B1F,$2826,$2527,$2223,$1F19,$1C0B
  595.         DC.W    $18F8,$15E1,$12C7,$0FAB,$0C8B,$096A,$0647,$0324
  596.         DC.W    $0000,$FCDB,$F9B8,$F695,$F374,$F054,$ED38,$EA1E
  597.         DC.W    $E707,$E3F4,$E0E6,$DDDC,$DAD8,$D7D9,$D4E0,$D1EF
  598.         DC.W    $CF04,$CC21,$C946,$C673,$C3A9,$C0E8,$BE32,$BB85
  599.         DC.W    $B8E3,$B64C,$B3C0,$B140,$AECC,$AC65,$AA0A,$A7BD
  600.         DC.W    $A57D,$A34C,$A128,$9F14,$9D0E,$9B17,$9930,$9759
  601.         DC.W    $9592,$93DC,$9236,$90A1,$8F1D,$8DAB,$8C4A,$8AFB
  602.         DC.W    $89BE,$8894,$877B,$8676,$8583,$84A3,$83D6,$831C
  603.         DC.W    $8276,$81E2,$8163,$80F6,$809E,$8059,$8027,$800A
  604.         DC.W    $8000,$800A,$8027,$8059,$809E,$80F6,$8163,$81E2
  605.         DC.W    $8276,$831C,$83D6,$84A3,$8583,$8676,$877B,$8894
  606.         DC.W    $89BE,$8AFB,$8C4A,$8DAB,$8F1D,$90A1,$9236,$93DC
  607.         DC.W    $9592,$9759,$9930,$9B17,$9D0E,$9F14,$A128,$A34C
  608.         DC.W    $A57D,$A7BD,$AA0A,$AC65,$AECC,$B140,$B3C0,$B64C
  609.         DC.W    $B8E3,$BB85,$BE32,$C0E8,$C3A9,$C673,$C946,$CC21
  610.         DC.W    $CF04,$D1EF,$D4E0,$D7D9,$DAD8,$DDDC,$E0E6,$E3F4
  611.         DC.W    $E707,$EA1E,$ED38,$F054,$F374,$F695,$F9B8,$FCDB
  612.         DC.W    $0000,$0324,$0647,$096A,$0C8B,$0FAB,$12C7,$15E1
  613.         DC.W    $18F8,$1C0B,$1F19,$2223,$2527,$2826,$2B1F,$2E10
  614.         DC.W    $30FB,$33DE,$36B9,$398C,$3C56,$3F17,$41CD,$447A
  615.         DC.W    $471C,$49B3,$4C3F,$4EBF,$5133,$539A,$55F5,$5842
  616.         DC.W    $5A82,$5CB3,$5ED7,$60EB,$62F1,$64E8,$66CF,$68A6
  617.         DC.W    $6A6D,$6C23,$6DC9,$6F5E,$70E2,$7254,$73B5,$7504
  618.         DC.W    $7641,$776B,$7884,$7989,$7A7C,$7B5C,$7C29,$7CE3
  619.         DC.W    $7D89,$7E1D,$7E9C,$7F09,$7F61,$7FA6,$7FD8,$7FF5
  620.         DC.W    $7FFF,$7FF5,$7FD8,$7FA6,$7F61,$7F09,$7E9C,$7E1D
  621.         DC.W    $7D89,$7CE3,$7C29,$7B5C,$7A7C,$7989,$7884,$776B
  622.         DC.W    $7641,$7504,$73B5,$7254,$70E2,$6F5E,$6DC9,$6C23
  623.         DC.W    $6A6D,$68A6,$66CF,$64E8,$62F1,$60EB,$5ED7,$5CB3
  624.         DC.W    $5A82,$5842,$55F5,$539A,$5133,$4EBF,$4C3F,$49B3
  625.         DC.W    $471C,$447A,$41CD,$3F17,$3C56,$398C,$36B9,$33DE
  626.         DC.W    $30FB,$2E10,$2B1F,$2826,$2527,$2223,$1F19,$1C0B
  627.         DC.W    $18F8,$15E1,$12C7,$0FAB,$0C8B,$096A,$0647,$0324
  628.         DC.W    $0000,$FCDB,$F9B8,$F695,$F374,$F054,$ED38,$EA1E
  629.         DC.W    $E707,$E3F4,$E0E6,$DDDC,$DAD8,$D7D9,$D4E0,$D1EF
  630.         DC.W    $CF04,$CC21,$C946,$C673,$C3A9,$C0E8,$BE32,$BB85
  631.         DC.W    $B8E3,$B64C,$B3C0,$B140,$AECC,$AC65,$AA0A,$A7BD
  632.         DC.W    $A57D,$A34C,$A128,$9F14,$9D0E,$9B17,$9930,$9759
  633.         DC.W    $9592,$93DC,$9236,$90A1,$8F1D,$8DAB,$8C4A,$8AFB
  634.         DC.W    $89BE,$8894,$877B,$8676,$8583,$84A3,$83D6,$831C
  635.         DC.W    $8276,$81E2,$8163,$80F6,$809E,$8059,$8027,$800A
  636.         DC.W    $8000,$800A,$8027,$8059,$809E,$80F6,$8163,$81E2
  637.         DC.W    $8276,$831C,$83D6,$84A3,$8583,$8676,$877B,$8894
  638.         DC.W    $89BE,$8AFB,$8C4A,$8DAB,$8F1D,$90A1,$9236,$93DC
  639.         DC.W    $9592,$9759,$9930,$9B17,$9D0E,$9F14,$A128,$A34C
  640.         DC.W    $A57D,$A7BD,$AA0A,$AC65,$AECC,$B140,$B3C0,$B64C
  641.         DC.W    $B8E3,$BB85,$BE32,$C0E8,$C3A9,$C673,$C946,$CC21
  642.         DC.W    $CF04,$D1EF,$D4E0,$D7D9,$DAD8,$DDDC,$E0E6,$E3F4
  643.         DC.W    $E707,$EA1E,$ED38,$F054,$F374,$F695,$F9B8,$FCDB
  644. vecplaneptr1    dc.l    vecplane1
  645. vecplaneptr2    dc.l    vecplane2
  646.     even
  647.     cnop    0,4
  648. vecbuff0    ds.b    80
  649. vecbuff1    ds.b    20*171
  650. vecbuff2    ds.b    20*172
  651. vecbuff3    ds.b    80
  652. vecplane1    ds.b    (40*171)*2
  653. vecplane2    ds.b    (40*171)*2
  654.         ds.b    80
  655.     even
  656.  
  657.     end
  658.  
  659.